package com.mingzhi.ai.controller;

import jakarta.annotation.Resource;
import org.springframework.ai.openai.OpenAiChatModel;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/api/deepseek")
public class DeepSeekController {

    @Resource
    private OpenAiChatModel openAiChatModel;

    /**
     * 聊天
     * @param message 用户的提示词
     * @return 模型返回的答案
     */
    @RequestMapping("/chat")
    public String chat(String message) {
        return openAiChatModel.call(message);
    }

}
